/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.cirnoworks.http.utils;

import com.cirnoworks.http.utils.Header;
import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 *
 * @author yuxuanhuang
 */
public class HeaderRequest extends Header {

    private String url;
    private String method;
    private String targetIp;
    private int targetPort;

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public String getTargetIp() {
        return targetIp;
    }

    public void setTargetIp(String targetIp) {
        this.targetIp = targetIp;
    }

    public int getTargetPort() {
        return targetPort;
    }

    public void setTargetPort(int targetPort) {
        this.targetPort = targetPort;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getRequestLine() {
        return method + " " + url + " " + protocal;
    }

    public InetAddress getTarget() throws UnknownHostException {
        return InetAddress.getByName(targetIp);
    }
}
